package com.enlorenz.core.channel.socket.common.translate;

import com.enlorenz.common.util.StreamUtils;
/**
 * 消息序列化转换器
 * 直接将实现了imessage接口的对象进行序列化
 * @author lcb
 */
public class MessageSerializeTransformer implements IMessageBytesTransformer<Object>{

	@Override
	public Object bytes2Message(byte[] data) {
		Object message=(Object)StreamUtils.transByteArray2Object(data);
		return message;
	}

	@Override
	public byte[] message2Bytes(Object message) {
		return StreamUtils.transObject2ByteArray(message);
	}

}
